package 方法;

public class Test {
	public static void main(String[] args) {
		MyThread my = new MyThread();
		for (int i = 1; i < 5; i++) {
			Thread th = new Thread();
			th.start();// 启动线程

		}
		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		synchronized (my) {
			my.notify();// 唤醒单个线程

		}
		try {
			Thread.sleep(3000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		synchronized (my) {
			my.notifyAll();// 唤醒全部线程
		}
	}

}
